#ifndef _XSCSIUSB_INCLUDE_XSCSIUSB_H_
#define _XSCSIUSB_INCLUDE_XSCSIUSB_H_
#include "xconfig.h"
#include "xusb_common.h"
#include "xusbdevice.h"

XUDC_API_BEGIN

void APICALL XSCSIUSB_API_PREFIX(version)(int *major, int *minor, int *build);

int APICALL XSCSIUSB_API_PREFIX(enumdevice)(int vid, int pid, TXUSBDevice deviceList[], int maxCout);

int APICALL XSCSIUSB_API_PREFIX(searchdevice)(unsigned short vid, unsigned short pid, char *szSerialNumber, PXUSBDevice deviceInfo);

void *APICALL XSCSIUSB_API_PREFIX(opendevice)(PXUSBDevice usbDevice);

int APICALL XSCSIUSB_API_PREFIX(closedevice)(void *handle);

#ifdef __ANDROID__
    void *APICALL XSCSIUSB_API_PREFIX(opendevice_fd)(int vid, int pid, int busNum, int dev_address, int fd);
    void *APICALL XSCSIUSB_API_PREFIX(opendevice_usbhost)(JavaVM *jvm, JNIEnv *env, jobject obj);
    int APICALL XSCSIUSB_API_PREFIX(closedevice_usbhost)(JavaVM *jvm, JNIEnv *env, void *handle);
#endif

#ifndef _WIN32
int APICALL XSCSIUSB_API_PREFIX(controltransfer)(void *handle, unsigned char bmRequestType, unsigned char bRequest, unsigned short wValue, unsigned short wIndex,
                                                 unsigned char *data, unsigned short wLength, unsigned int timeout);
void APICALL XSCSIUSB_API_PREFIX(resetdevice)(void *handle);
#endif

BOOL APICALL XSCSIUSB_API_PREFIX(write)(void *hDevice, unsigned char *DataBuffer, int DataTransferLength, int TimeOutValue);
BOOL APICALL XSCSIUSB_API_PREFIX(read)(void *hDevice, unsigned char *DataBuffer, int DataTransferLength, int TimeOutValue);
int APICALL XSCSIUSB_API_PREFIX(inquiry)(void *hDevice, unsigned char *buffer, int cbBuffer);
BOOL APICALL XSCSIUSB_API_PREFIX(transmit)(void *hDevice, unsigned char *cdb, unsigned int cdbSize, unsigned char DataIn, unsigned char *DataBuffer, int DataTransferLength, int timeOut);

XUDC_API_END

#endif